import { _decorator, Component, Node } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('button')
export class button extends Component {
    @property(Node)
    hero: Node
    start() {

    }

    update(deltaTime: number) {
        const x = this.hero.worldPosition.x - this.node.worldPosition.x
        this.node.setPosition(this.hero.worldPosition.x - x, this.node.position.y)
    }
}


